import checkPermission from '@/utils/permission'

export default {
  inserted(el, binding) {
    const { value, modifiers } = binding
    const hasPermission = checkPermission(value, modifiers)
    if (!hasPermission) {
      el.parentNode && el.parentNode.removeChild(el)
    }
  },
}
